package com.meizi.utils;

import com.meizi.enums.ErrorCodeEnum;

/**
 * @author Administration
 * @date 2021/8/9 - 14:32 - 星期一
 * @project lambda
 * @package com.meizi.utils
 * @by GGbomd猪猪侠
 */
public class ErrorCodeUtils {
    public ErrorCodeUtils() {
    }

    public static String getMsg(int code) {
        String msg = ErrorCodeEnum.queryValueByKey(code);
        return "".equals(msg) ? ErrorCodeEnum.INTERNAL_SERVER_ERROR.getValue() : msg;
    }

    public static String getMsg(int code, String params) {
        String msg = ErrorCodeEnum.queryValueByKey(code);
        return params;
    }

    public static String getMsg(int code, String[] params) {
        return params.toString();
    }
}
